import { loginApi, sendCodeApi } from '@/api/login';
import { setAuth } from '@/utils/storage';

export const sendCodeAction = (mobile: string) => {
  return async () => {
    await sendCodeApi(mobile);
  };
};
export const loginAction = (mobile: string, code: string) => {
  return async () => {
    const res = await loginApi(mobile, code);
    setAuth(res.data);
  };
};
